{% case include.artifact %}
{% when 'io.ktor:ktor-server-core:$ktor_version' %}
{% assign artifact_required = false %}
{% when 'io.ktor:ktor-client-core:$ktor_version' %}
{% assign artifact_required = false %}
{% else %}
{% assign artifact_required = true %}
{% endcase %}

{% assign artifacts = include.artifact | split: ',' %}

{% capture _ignored %}{% increment autoid %}{% endcapture %}

<div class="note artifact artifact-small exclude-anchor" id="artifact-info-{{ autoid }}">
    <div class="note-inner" id="artifact-{{ autoid }}">
        {% if include.kind %}
        本{{ include.kind }}在<!--
        {% else %}
        本特性在<!--
        {% endif %}

        {% if artifact_required %}
        -->构件 <code class="highlighter-rouge">{{ include.artifact }}</code> 中的
        {% else %}
        -->
        {% endif %}

        {% if include.method %}
        <code class="highlighter-rouge">{{ include.method }}</code> 方法中<!--
        {% elsif include.package %}
        <code class="highlighter-rouge">{{ include.package }}</code> 包中<!--
        {% else %}
        <code class="highlighter-rouge">{{ include.class }}</code> 类中<!--
        {% endif %}-->定义<!--
        {% if artifact_required %}
        -->。
        {% else %}
        -->，无需任何额外构件。
        {% endif %}

        {% if include.transitive %}
        它包含传递依赖 <code class="highlighter-rouge">{{ include.transitive }}</code>。
        {% else %}
        <!-- It does not include any additional transitive dependencies. -->
        {% endif %}

    </div>
    {% if artifact_required %}
    <ul class="nav nav-tabs artifact-tabs">
        <li role="presentation" class="active"><a data-toggle="tab" href="#artifact-gradle-{{ autoid }}">Gradle</a></li>
        <li role="presentation"><a data-toggle="tab" href="#artifact-gradle-kotlin-{{ autoid }}">Gradle Kotlin DSL</a>
        </li>
        <li role="presentation"><a data-toggle="tab" href="#artifact-maven-{{ autoid }}">Maven</a></li>
    </ul>
    <div class="tab-content artifact-tab-content"
        style="background:white; padding: 0.5em 1em; border: 1px solid #ddd; border-top: none;">
        <div id="artifact-gradle-{{ autoid }}" class="tab-pane fade in active">
            {% if include.test %}
            <div><code style="white-space: pre;font-size: 0.9em">dependencies {
{% for artifact in artifacts %}    api "{{ artifact }}"
{% endfor -%}
}
</code></div>
            {% else %}
            <div>

                <code style="white-space: pre;font-size: 0.9em">dependencies {
{% for artifact in artifacts %}    implementation "{{ artifact }}"
{% endfor -%}
}
</code>
            </div>
            {% endif %}
        </div>
        <div id="artifact-gradle-kotlin-{{ autoid }}" class="tab-pane fade in">
            {% if include.test %}
            <div><code style="white-space: pre;font-size: 0.9em">dependencies {
{% for artifact in artifacts %}    testImplementation("{{ artifact }}")
{% endfor -%}
}
</code></div>
            {% else %}
            <div><code style="white-space: pre;font-size: 0.9em">dependencies {
{% for artifact in artifacts %}    implementation("{{ artifact }}")
{% endfor -%}
}
</code></div>
            {% endif %}
        </div>
        <div id="artifact-maven-{{ autoid }}" class="tab-pane fade in">
            <div><code style="white-space: pre;font-size: 0.9em">&lt;project&gt;
    ...
    &lt;dependencies&gt;
{%- for artifact in artifacts -%}
    {%- assign artifact_parts = artifact | split: ':' -%}
    {%- assign artifact_group = artifact_parts[0] -%}
    {%- assign artifact_name = artifact_parts[1] -%}
    {%- assign artifact_version = artifact_parts[2] %}
        &lt;dependency&gt;
            &lt;groupId&gt;{{ artifact_group }}&lt;/groupId&gt;
            &lt;artifactId&gt;{{ artifact_name }}&lt;/artifactId&gt;
            &lt;version&gt;${ktor.version}&lt;/version&gt;
            &lt;scope&gt;{% if include.test %}test{% else %}compile{% endif %}&lt;/scope&gt;
        &lt;/dependency&gt;
{%- endfor %}
    &lt;/dependencies&gt;
&lt;/project&gt;
</code></div>
        </div>
    </div>
    {% endif %}

</div>
